function [Ws] = WaitTime(s,lambda,miu)
%计算乘客平均上车用时
E_T=1/lambda;
E_Ts=1/miu;
everage_service=s*miu;
rou=lambda/everage_service;% 服务强度 ρ
lam_miu=lambda/miu;
free_p=(sum((1/factorial(k))*(lam_miu^k))+(1/factorial(s))*(1/1-rou)*(lam_miu^s));
free_p=free_p^-1; %上车点空闲的概率 P0
Wait_number=(s*rou)^s*rou*free_p/(factorial(s)*(1-rou)^2); %排队等待乘车的乘客数
q_wait_time=Wait_number/lambda; %一个乘客排队等待的时间
s_wait_time=q_wait_time+1/miu; %一个乘客排队等待和乘车的总时间
Ws=s_wait_time;
end

